
//
//  SwiftBasicTableView.swift
//  Project_Demo
//
//  Created by caoxiaozhu on 2018/8/10.
//  Copyright © 2018年 caoxiaozhu. All rights reserved.
//

import UIKit

class SwiftBasicTableView: XZ_BaseTableViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        view.backgroundColor = UIColor.white
        setupDataArr([
            ["基础的Swift知识","BaseSwift"],
            ["中级Swift知识","MiddleSwift"],
            ["Swift4中新知识","NewSwift4"],
            ["Swfit计算器","Calculator"],
            ["私人通讯录","PersonalAddressBook"]
            ])
    }
    
    override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        
        guard let className : String = classNames[indexPath.row] as? String else {
            return
        }
        
        let finalClassName = "ProjectDemo.\(className)"
        let cls  = NSClassFromString(finalClassName) as? UIViewController.Type
        let vc = cls?.init()
        self.navigationController?.pushViewController(vc!, animated: true)
//        print(className)
        
    }
}
